<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>个人中心</title>
    <style>
        .container {
            width: 80%;
            margin: 0 auto;
            padding: 20px;
        }
        .profile-form {
            max-width: 600px;
            margin: 20px auto;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        .form-group input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 3px;
        }
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }
        .btn-primary {
            background-color: #4CAF50;
            color: white;
        }
        .btn-primary:hover {
            background-color: #45a049;
        }
        .message {
            margin: 10px 0;
            padding: 10px;
            border-radius: 3px;
        }
        .success {
            background-color: #dff0d8;
            color: #3c763d;
            border: 1px solid #d6e9c6;
        }
        .error {
            background-color: #f2dede;
            color: #a94442;
            border: 1px solid #ebccd1;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="profile-form">
        <h2>个人信息</h2>

        <c:if test="${not empty message}">
            <div class="message ${messageType}">${message}</div>
        </c:if>

        <form action="personalupdate" method="post">
            <div class="form-group">
                <label>学号：</label>
                <input type="text" name="studentId" value="${studentInfo.studentId}" readonly>
            </div>

            <div class="form-group">
                <label>姓名：</label>
                <input type="text" name="name" value="${studentInfo.name}" required>
            </div>

            <div class="form-group">
                <label>年级：</label>
                <input type="text" name="grade" value="${studentInfo.grade}" required>
            </div>

            <div class="form-group">
                <label>班级：</label>
                <input type="text" name="classes" value="${studentInfo.classes}" required>
            </div>

            <div class="form-group">
                <label>邮箱：</label>
                <input type="email" name="email" value="${studentInfo.email}" required>
            </div>

            <button type="submit" class="btn btn-primary">保存修改</button>
            <a href="index.jsp" class="btn">返回首页</a>
        </form>
    </div>
</div>
</body>
</html>